<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="js/vue.js"></script>
</head>
<body>
<div id="app">
    <login></login>
    <register v-bind:myvue="vuemsg">
    </register>
</div>
<template id="login">
    <div>
        {{lmsg}}
    </div>
</template>

<template id="register">
    <div>
        {{myvue}}
        {{rmsg}}
    </div>
</template>
<script>
    new Vue({
        el: '#app',
        data: {
            vuemsg: '这是vue的数据'
        },
        components: {
            login: {
                template: '#login',
                data (){
                    return {
                        lmsg: '这是登录页面'
                    }
                }
            },
            register: {
                template: '#register',
                data () {
                    return {
                        rmsg: '这是注册页面'
                    }
                },
                props: ['myvue']
            }
        }
    })
</script>
</body>
</html>
